#pragma once
#include"MyHash.h"
namespace celia
{
	template<class K, class V, class Hash = HashFunc<K>>
	class unordered_map
	{
		struct SetKeyOfV
		{
			const K& operator()(const pair<K, V>& val)
			{
				return val.first;
			}
		};
	public:
		typedef typename HashTable<K, pair<const K, V>, SetKeyOfV, Hash>::Iterator iterator;
		typedef typename HashTable<K, pair<const K, V>, SetKeyOfV, Hash>::Const_Iterator const_iterator;

		iterator begin()
		{
			return _tb.Begin();
		}
		iterator end()
		{
			return _tb.End();
		}
		const_iterator begin() const
		{
			return _tb.Begin();
		}
		const_iterator end() const
		{
			return _tb.End();
		}
		pair<iterator, bool> Insert(const pair<const K, V>& data)
		{
			return _tb.Insert(data);
		}
		bool Erase(const K& key)
		{
			return _tb.Erase(key);
		}
	private:
		HashTable<K, pair<const K, V>, SetKeyOfV, Hash> _tb;
	};
	
}